import { createSlice } from "@reduxjs/toolkit";

export interface orgType {
  id: string;
  name: string;
}

const orgSlice = createSlice({
  name: "org",
  initialState: {
    currentOrg: {} as orgType
  },
  reducers: {
    setCurrentOrg(state, { payload }) {
      state.currentOrg = payload as orgType;
    }
  }
});

export const { setCurrentOrg } = orgSlice.actions;
export default orgSlice.reducer;
